import React from 'react'
import { withRouter } from 'react-router-dom'

import Bar from '../Bar'
import './style.css'

const BuyBar = ({ history }) => {
    const goHome = () => {
        history.push('/')
    }
    const goCart = () => {
        history.push('/cart')
    }
    const createOrder = () => {
        history.push('/createOrder')
        console.log('createOrder - ')
    }
    let left = (
        <div className='buyBar-service'>
            <div onClick={goHome}>
                <i className='iconfont icon-home'></i>
                <span>店铺</span>
            </div>
            <div onClick={goCart}>
                <i className='iconfont icon-gouwuche-01'></i>
                <span>购物袋</span>
            </div>
        </div>
    )
    let right = (
        <div 
            className='buyBar-addCard'
            
        >
            <span style={{ fontSize: 14 }}>
                加入购物车
            </span>
        </div>
    )
    return (
        <Bar
            className='buyBar'
            left={left}
            right={right}
            clickBuy={createOrder}
        />
    )
}

export default withRouter(BuyBar)
